<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 公司薪资原始字段设置
 *
 * Date: 2018/6/4
 * @author George
 */
class CreateCompanyOriginalPivotTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('company_original_pivot', function (Blueprint $table) {
            $table->unsignedInteger('company_id')->index()->comment('公司ID');
            $table->unsignedInteger('pattern_id')->index()->comment('薪资方案ID');
            $table->unsignedInteger('original_id')->index()->comment('原始字段设置ID');
            $table->boolean('status')->default(1)->comment('是否开启');
            $table->primary(['company_id', 'pattern_id', 'original_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('company_original_pivot');
    }
}
